package com.kungkhies.mvc.kungkhie;

import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;

import com.kungkhies.domain.kungkhie.KungkhieSummary;

public class KungkhieBackingBeanInterceptor
        implements WebRequestInterceptor
{
    public void afterCompletion(WebRequest webRequest,
            Exception arg1) throws Exception
    {
    }

    public void postHandle(WebRequest webRequest, ModelMap model)
            throws Exception
    {
        // TODO: Maybe should only do this if the user is logged in
        if (model != null)
        {
            model.addAttribute(new KungkhieSummary());
        }
    }

    public void preHandle(WebRequest webRequest) throws Exception
    {
    }
}
